package com.isky.visual.db.mapper;

import com.isky.visual.db.entity.Source;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 数据库连接的配置表 Mapper 接口
 * </p>
 *
 * @author wudl
 * @since 2020-04-14
 */
@Mapper
@Repository
public interface SourceMapper extends BaseMapper<Source> {
    @Update("update db_source set valid = 0 where id =#{id}")
    int logicDelete(@Param("id") Long id);

    @Delete("delete from meta_data where database_id = #{id}")
    int deleteMetaDataByDbId(@Param("id") Long id);
}
